package procimagem;

import java.io.File;

import javax.swing.filechooser.FileFilter;

public class PGMFileFilter extends FileFilter {

	private final String EXT = ".pgm";
	private String descr;

	public PGMFileFilter(String descr){
		this.descr = descr;
	}

	@Override
	public boolean accept(File f) {
		if (f.isDirectory())
			return true;

		if (f.getName().toLowerCase().endsWith(this.EXT))
			return true;

		return false;
	}

	@Override
	public String getDescription() {
		return this.descr;
	}

}
